#ifndef SINGLEPROCESSTASK_H
#define SINGLEPROCESSTASK_H

#include <QRunnable>
#include <QObject> //for signal
#include <QRandomGenerator>
#include <QThread>
#include <QProcess>
#include <QFile>

class SingleProcesstask : public QObject,  public QRunnable
{
    Q_OBJECT
public:
    SingleProcesstask(int taskIndex,QString argument,QString input,QString output,bool reVerify,bool delSource);
    ~SingleProcesstask();

    void run() override;

private:
    //函数
    void reConvert();

    //process
    const QString cjxlFilename="jxl-x64-windows-static/cjxl.exe";
    const QString djxlFilename="jxl-x64-windows-static/djxl.exe";
    QProcess *cjxlencoder,*jxldecoder;

    //参数
    int index;
    QString argument,inputTarget,outputTarget;
    bool Flag_reVerify,Flag_delSource;

signals:
    void convertLog(QString);
    void convertResult(int num,int result);
};

#endif // SINGLEPROCESSTASK_H
